#!/usr/bin/python
# -*- coding:UTF-8 -*-

var1 = 'Hello World!'

print("output :- ", var1[:6] + 'Runoob')

print("My name is %s and weight is %d kg!" % ('Zara', 21))

s = 'a, B'
print(s.capitalize())

s = ' a, B'
print(s.capitalize())

s = 'a, BCD'
print(s.capitalize())

str01 = 'runoob'
print(str01.center(20,'*'))
print(str01.center(20))

str02 = "this is string example....wow!!!"

sub = 'i'
print("str.count(sub, 4, 40) : ", str02.count(sub, 4, 40))
print(str02.count(sub))
sub = 'wow'
print("str.count(sub) : ", str02.count(sub))

str02 = str02.encode('base64', 'strict')
print("Encoded String: " + str02)
print("Decoded String: " + str02.decode('base64', 'strict'))
str02 = str02.decode('base64', 'strict')

suffix = 'wow!!!'
print(str02.endswith(suffix))
print(str02.endswith(suffix, 20))

suffix = 'is'
print(str02.endswith(suffix, 2, 4))
print(str02.endswith(suffix, 2, 6))

str03 = "this is\tstring example....wow!!!"

print("Original string: " + str03)
print("Default exapanded tab: " + str03.expandtabs())
print("Double exapanded tab: " + str03.expandtabs(16))

str04 = "exam"

print(str03.find(str04))
print(str03.find(str04, 10))
print(str03.find(str04, 40))

print("{} {}".format("hello", "world"))
print("{0} {1}".format("hello", "world"))
print("{1} {0} {1}".format("hello", "world"))

print("WebSite: {name}, address: {url}".format(name="runoob", url = "www.runoob.com"))

site = {"name": "runoob", "url":"www.runoob.com"}
print("WebSite: {name}, url: {url}".format(**site))

my_list = ['runoob', 'www.runoob.com']
print("webSite: {0[0]}, url: {0[1]}".format(my_list))

class AssignValue(object):
    def __init__(self, value):
        self.value = value

my_value = AssignValue(6)
print("value = {0.value}".format(my_value))